package com.easy.neo4j.controller;

import com.easy.common.util.Result;
import com.easy.neo4j.entry.Rail;
import com.easy.neo4j.service.RailService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: CoolPro
 * @Description:
 * @Time: 2024-03-31 22:56
 **/
@RestController
@RequestMapping("/rail")
@CrossOrigin
public class RailController {

    @Resource
    RailService railService;

    @RequestMapping("/query/{name}")
    public Result<List<Rail>> query(@PathVariable(value = "name") String parkName) {
        System.out.println(parkName);
        return railService.findRailByName(parkName);
    }
}
